log.debug("XendDomainInfo.restore(%s)", config)
- vm = XendDomainInfo(parseConfig(config))
+ vm = XendDomainInfo(parseConfig(config), None, None, False, False, True)
try:
vm.construct()
vm.storeVmDetails()
vm.createDevices()
vm.createChannels()
vm.storeDomDetails()
+ vm.endRestore()
return vm
except:
vm.destroy()
class XendDomainInfo:
def __init__(self, info, domid = None, dompath = None, augment = False,
- priv = False):
+ priv = False, resume = False):
self.info = info
self.state_updated = threading.Condition()
self.refresh_shutdown_lock = threading.Condition()
+ self.setResume(resume)
## private:
"""Get this domain's target memory size, in KB."""
return self.info['memory'] * 1024
+ def getResume(self):
+ return "%s" % self.info['resume']
+
+ def endRestore(self):
+ self.setResume(False)
+
+ def setResume(self, state):
+ self.info['resume'] = state
def refreshShutdown(self, xeninfo = None):
# If set at the end of this method, a restart is required, with the
log.info("The domain has a TPM with instance %d and devid %d.",
inst, devid)
- back = { 'pref_instance' : "%i" % inst }
+ back = { 'pref_instance' : "%i" % inst,
+ 'resume' : "%s" % (self.vm.getResume()) }
front = { 'handle' : "%i" % devid }
return (devid, back, front)